<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\ListController;
use common\models\articles\Articles;
use common\models\member\Member;
use common\models\category\Category;
use common\models\Fenhuigrade\Fenhuigrade;
    $tongzhi = Articles::find()->where(['category_id'=>18, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $zhengce = Articles::find()->where(['category_id'=>25, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $hangye = Articles::find()->where(['category_id'=>28, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $pinpai = Articles::find()->where(['category_id'=>23, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
    $xinwen = Articles::find()->where(['category_id'=>14, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
        // 会员风采
    $memberstyle = Member::find()->where(['status' => Member::STATUS_SUCCESS])->asArray()->limit(12)->all();
    $membersytletype = Category::find()->where(['id' =>20])->asArray()->one()['ctype'];

    $fenhui = Fenhuigrade::find()->where(['status' => Fenhuigrade::STATUS_ACTIVE])->limit(6)->all();

?>
    <style>
        .divtoneulimg{
            margin-right: -33px;
        }
        .divtoneulimg li{
            margin-right: 36px;
        }
    </style>

    <div class="content">
        <div class="w1200 clearFloat mb50">
		   <h3 class="abouth3">当前位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> > <a href="<?= yii\helpers\Url::to([$parentinfo['type'], 'id' => $parentinfo['id']]); ?>"><?= $parenttitle; ?> > </a><a> <?= $title; ?></a></h3>
            <div class="clearFloat">
                <div class="jjleft floatLeft">
                    <div class="clearFloat">
                        <h3 class="jjtitle"><?php echo $parenttitle; ?></h3>
                        <ul class="jjul">
                            <?php foreach($childcat as $t){ ?>
                            <li<?php if($id == $t['id']){echo ' class="jjactive"';} ?>>
                                <a href="<?= yii\helpers\Url::to([$t['type'], 'id' => $t['id']]); ?>">
                                    <?php echo $t['name']; ?>
                                </a>
                            </li>
                            <?php } ?>
                       </ul>
                    </div>
                </div>
                <div class="jjmiddle floatLeft">
                    <div class="clearFloat">
                        <ul class="wylist">
                            <?php foreach($articles as $k=>$t){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to([$ctype, 'id' => $t['id']]); ?>">
                                    <h3><?=$t['title'];?></h3>
                                    <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?= mb_substr(strip_tags($t['intro']),0,103,'utf-8'); ?><?php if(strlen($t['intro']) > 310) { echo '...'; } ?></span>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                        <div class="newpage mt50 mb50">
                                <?php if($page)
                                {
                                    echo LinkPager::widget([
                                    'maxButtonCount' => 6,
                                    'prevPageLabel' =>'&lt;',
                                    'nextPageLabel' =>'&gt;',
                                    'pagination'=>$page,
                                ]);
                                }
                                ?>
                        </div>
                    </div>
                </div>
                <div class="jjright floatRight">
                    <?php if($id == 14 or $id == 18) { ?>
                    <div class="clearFloat ppjs">
                        <h3 class="indexh3"><span>品牌建设</span></h3>
                        <ul class="divtoneul">
                           <?php foreach($pinpai as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>行业研究</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($hangye as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>政策法规</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($zhengce as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                <?php }elseif($id == 23){ ?>
                    <div class="clearFloat mt10">
                        <h3 class="indexh3"><span>会员风采</span></h3>
                        <ul class="hyfcdiv clearFloat">
                            <?php foreach($memberstyle as $t) { ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to([$membersytletype, 'id'=>$t['id']])?>"><img src="/upload/<?= json_decode($t['faceimg'], true)['newname'];?>" alt=""></a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>行业研究</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($hangye as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>政策法规</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($zhengce as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>

                <?php }elseif($id == 25){ ?>
                    <div class="clearFloat ppjs">
                        <h3 class="indexh3"><span>协会新闻</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($xinwen as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                            <?php } ?>
                      </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>通知公告</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($tongzhi as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>行业研究</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($hangye as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <?php }elseif($id == 16){ ?>
                     <div id="Rt">
                          <h3 class="h3_li">协会机构</h3>
                          <ul class="yuan">
                            <?php foreach($fenhui as $t){ ?>
                              <li style="margin-bottom:30px;"><a href="<?= yii\helpers\Url::to(['content/fenhui', 'id'=>$t['id']])?>"><span><img src="<?= yii::getAlias('@web');?>/upload/<?= json_decode($t['label_img'], true)['newname'];?>" /></span><p><?= $t['name'];?></p></a></li>
                              <?php } ?>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                              
                          </ul>
                          
                          <h3 class="h3_li">会员天地</h3>
                          <ul class="yuan">
                              <li><a href="<?= yii\helpers\Url::to(['list/memberstyle','id' => 20]); ?>"><span style="border:1px solid #d3d3d3"><img src="<?= yii::getAlias('@web');?>/images/fengcai.png" /></span><p style="color:#ebebeb">会员风采</p></a></li>
                              <li><a href="<?= yii\helpers\Url::to(['content/index','id' => 21]); ?>"><span style="border:1px solid #d3d3d3"><img src="<?= yii::getAlias('@web');?>/images/quanyi.png" /></span><p style="color:#ebebeb">会员权益</p></a></li>
                              <li><a href="<?= yii\helpers\Url::to(['member/apply']); ?>"><span style="border:1px solid #d3d3d3"><img src="<?= yii::getAlias('@web');?>/images/ruhui.png" /></span><p style="color:#ebebeb">申请入会</p></a></li>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                              
                          </ul>
                          
                          <h3 class="h3_li">会员风采</h3>
                          <ul class="yuan">
                              <?php foreach($memberstyle as $t) { ?>
                              <li style="margin-bottom:30px;border:1px solid #d3d3d3; height:75px;"><a href="<?= yii\helpers\Url::to([$membersytletype, 'id'=>$t['id']])?>"><span><img src="/upload/<?= json_decode($t['faceimg'], true)['newname'];?>" alt=""></span></a></li>
                              <?php } ?>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                              <li class="Fix"></li>
                          </ul>
                     </div>
                    <?php }else{ ?>
                    <!-- $id == 27 or $id ==28 -->
                    <div class="clearFloat ppjs">
                        <h3 class="indexh3"><span>协会新闻</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($xinwen as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                            <?php } ?>
                      </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>通知公告</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($tongzhi as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt15">
                        <h3 class="indexh3"><span>政策法规</span></h3>
                        <ul class="divtoneul">
                            <?php foreach($zhengce as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>